package com.efast.dmom.mes.bean.base;


public enum RowStatusType {
	DELETE("删除",0),
	NORMAL("有效",1),
	DISABLE("禁用",2),
	UNACTIVATED("未激活",3),
	UNUSED("弃用",4);
	
	private String status;
	private int code;
	
	private  RowStatusType(String status,int code) {
		this.status=status;
		this.code=code;
	}

		
	public String getStatus() {
		return status;
	}


	public void setStatus(String status) {
		this.status = status;
	}


	public int getCode() {
		return code;
	}


	public void setCode(int code) {
		this.code = code;
	}


	public static String getStatus(int code) {
		for(RowStatusType type:RowStatusType.values()) {
			if(code == type.getCode()) {
				return type.getStatus();
			}
		}
		return null;
	}
	
	public static int getCode(String status) {
		if(status==null) {
			return -1;
		}
		for(RowStatusType type:RowStatusType.values()) {
			if(status.equals(type.getStatus())) {
				return type.getCode();
			}
		}
		return -1;
	}

	@Override
	public String toString() {
		return this.code+":"+this.status;
	}

	
}
